qx.Class.define("qx.ui.form.ow.FormTab",
{
	extend : qx.ui.tabview.Page,
	properties :
	{
		Id :
	    {
			nullable : false,
			init : null,
			apply : "_applyId",
			check : "String"
	    }
	},
	construct : function (id, label, icon, dontClose)
	{
		this.base(arguments);

		this.setId(id);
		
		if (label != null)
			this.setLabel(label);
		if (icon != null)
      		this.setIcon(icon);
		
		this.setLayout(new qx.ui.layout.Grow());

		this._layoutBody = new qx.ui.container.Scroll();

		this._body = new qx.ui.window.Desktop(new qx.ui.window.Manager());
		this._body.set({decorator: "main", backgroundColor: "background-pane"});
		
		this._layoutBody.add(this._body);

		this._add(this._layoutBody);
		
		if (! dontClose)
		{
			this.setShowCloseButton(true);
		}
//		if (! dontClose)
//		{
//			var buttonClose = new qx.ui.basic.Image("decoration/window/close-inactive.png").set({marginRight : -2 });
//			buttonClose.addListener("mousemove", function () { this.setSource("decoration/window/close-active.png") }, buttonClose);
//			buttonClose.addListener("mouseout", function () { this.setSource("decoration/window/close-inactive.png") }, buttonClose);
//			buttonClose.addListener("click", function () { this.fireEvent("close"); }, this);
//			this.getButton()._add(buttonClose);
//		}
	},
	members :
	{
		_layoutBody : null,
		_body : null,
		_widgets : null,
		_loginOk : null,
		_applyId : function (id)
		{
			this._id = id;
		},
		add : function (widget, position)
		{
			// guardar ID del widget en esta linea
			this._body.add(widget, position);
		},
		removeWidget : function (widget)
		{
			
		},
		hideWidget : function (widget)
		{
			
		},
		showWidget : function (widget)
		{
			
		},
		_isAutorized : function ()
		{
			//retorna true o false
		}
	}
});
